package app.fugema.shop.main.order.model;


import com.base.common.utils.UIUtils;
import com.base.common.view.adapter.bean.HeaderBean;
import com.base.common.view.adapter.connector.BaseItemTypeInterface;

import java.util.ArrayList;
import java.util.List;


public class GroupPeopleHeadBean extends HeaderBean
{

    private String JoinTime;
    private int JoinStatus;
    private String OverTime;
    private int GroupStatus;
    private int LimitedNumber;
    private int LimitedHour;
    private int JoinedNumber;
    private String AddGroupTime;
    private List<GroupDetailResult.OrderDetailBean.UserInfoBean> UserInfo;
    private int Seconds;
    private int GetJoinStatus;
    private List<String> userIcons;

    public String getJoinTime()
    {
        return JoinTime;
    }

    public void setJoinTime(String joinTime)
    {
        JoinTime = joinTime;
    }

    public int getJoinStatus()
    {
        return JoinStatus;
    }

    public void setJoinStatus(int joinStatus) {
        JoinStatus = joinStatus;
    }

    public String getOverTime() {
        return OverTime;
    }

    public void setOverTime(String overTime) {
        OverTime = overTime;
    }

    public int getGroupStatus() {
        return GroupStatus;
    }

    public void setGroupStatus(int groupStatus) {
        GroupStatus = groupStatus;
    }

    public int getLimitedNumber() {
        return LimitedNumber;
    }

    public void setLimitedNumber(int limitedNumber) {
        LimitedNumber = limitedNumber;
    }

    public int getLimitedHour() {
        return LimitedHour;
    }

    public void setLimitedHour(int limitedHour) {
        LimitedHour = limitedHour;
    }

    public int getJoinedNumber() {
        return JoinedNumber;
    }

    public void setJoinedNumber(int joinedNumber) {
        JoinedNumber = joinedNumber;
    }

    public String getAddGroupTime() {
        return AddGroupTime;
    }

    public void setAddGroupTime(String addGroupTime) {
        AddGroupTime = addGroupTime;
    }

    public List<GroupDetailResult.OrderDetailBean.UserInfoBean> getUserInfo() {
        return UserInfo;
    }

    public void setUserInfo(List<GroupDetailResult.OrderDetailBean.UserInfoBean> userInfo) {
        UserInfo = userInfo;
    }

    public int getSeconds() {
        return Seconds;
    }

    public void setSeconds(int seconds) {
        Seconds = seconds;
    }

    public int getGetJoinStatus() {
        return GetJoinStatus;
    }

    public void setGetJoinStatus(int getJoinStatus) {
        GetJoinStatus = getJoinStatus;
    }

    public List<String> getUserIcons() {
        return userIcons;
    }

    public void setUserIcons(List<String> userIcons) {
        this.userIcons = userIcons;
    }

    public static GroupPeopleHeadBean getGroupPeopleByGroupInfo(GroupDetailResult.OrderDetailBean orderInfo)
    {
        GroupPeopleHeadBean gPeople = new GroupPeopleHeadBean();

        gPeople.setJoinTime( orderInfo.getJoinTime() );
        gPeople.setJoinStatus( orderInfo.getJoinStatus() );
        gPeople.setOverTime(orderInfo.getOverTime());
        gPeople.setGroupStatus( orderInfo.getGroupStatus());
        gPeople.setLimitedNumber( orderInfo.getLimitedNumber() );
        gPeople.setLimitedHour( orderInfo.getLimitedHour() );
        gPeople.setJoinedNumber( orderInfo.getJoinedNumber() );
        gPeople.setAddGroupTime( orderInfo.getAddGroupTime() );
        gPeople.setSeconds( orderInfo.getSeconds() );
        gPeople.setGetJoinStatus( orderInfo.getGetJoinStatus() );

        if(UIUtils.isNotEmpty( orderInfo.getUserInfo() ))
        {
            gPeople.setUserInfo( orderInfo.getUserInfo() );
            List<String> list = new ArrayList<>();
            if (UIUtils.isNotEmpty(orderInfo.getUserInfo()))
            {
                for (int i = 0; i < orderInfo.getUserInfo().size(); i++)
                {
                    list.add(orderInfo.getUserInfo().get(i).getPhoto());
                }
            }
            gPeople.setUserIcons( list );
        }
        gPeople.setItemType( BaseItemTypeInterface.TYPE_HEAD_TWO );
        return gPeople;
    }
}
